"""mydailyfresh URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))

会有报错:ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported.
Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.
参考: https://www.cnblogs.com/letgo-doo/p/9110347.html
在include方法里面指定namespace却不提供app_name是不允许的。
方法一在包含的模块里设置app_name变量，或者方法二在include方法里面提供app_name参数。
"""
from django.contrib import admin
from django.urls import path, re_path, include

urlpatterns = [
    path('admin/', admin.site.urls),
    re_path(r'^tinymce/', include('tinymce.urls')),  # 富文本编辑器
    re_path(r'^user/', include('apps.user.urls', namespace='user')),  # 用户模块
    re_path(r'^cart/', include(('apps.cart.urls', 'cart'), namespace='cart')),  # 购物车模块
    re_path(r'^order/', include(('apps.order.urls', 'order'), namespace='order')),  # 订单模块
    re_path(r'^', include(('apps.goods.urls', 'goods'), namespace='goods')),  # 商品模块，必须要将匹配所有路径的放在最后，这样才保证了不会所有的请求都匹配到此处去了。匹配的顺序是依次执行的。
]
